//登录规则
const validateName = (rule,value,callback) => {
  if (!value) {
      return callback(new Error("用户名不能为空"));
  }else {
      callback();
  }
};
export const validatePassword = (rule,value,callback) => {
    if (value === "") {
        return callback(new Error("密码不能为空"));
    }else {
        callback();
    }
};
export const SignInRules = {
    username:[{validator:validateName,trigger:"blur",min:3}],
    password:[{validator:validatePassword,trigger:"blur",min:3}],
};
//注册规则
export const SignUpRules = {
    username:[{required:true,trigger:"blur",min:3}],
    password:[{required:true,trigger:"blur",min:3}],
};
